﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UWarrantyCardAgentList.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.UWarrantyCardAgentList" %>
<form id="pagerForm" method="post" action="SvrMgr/UWarrantyCardAgentList.aspx">
<input type="hidden" name="SerialNumber" value="<%=SerialNumber %>" />
<input type="hidden" name="CustomerName" value="<%=CustomerName %>" />
<input type="hidden" name="CustomerIDCard" value="<%=CustomerIDCard %>" />
<input type="hidden" name="AgentName" value="<%=AgentName %>" />
<input type="hidden" name="searchAgentName" value="<%=searchAgentName %>" />
<input type="hidden" name="Birthday" value="<%=Birthday %>" />
<input type="hidden" name="AgentAddress" value="<%=AgentAddress %>" />
<input type="hidden" name="IntoDateFrom" value="<%=IntoDateFrom %>" />
<input type="hidden" name="IntoDateTo" value="<%=IntoDateTo %>" />
<input type="hidden" name="ShowTimeInput" value="<%=ShowTimeInput?false:ShowTimeInput %>" />
<input type="hidden" name="MachineType" value="<%=MachineType %>" />

<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
</form>
<form id="form1" runat="server" method="post" action="SvrMgr/UWarrantyCardAgentList.aspx" onsubmit="return navTabSearch(this);">
<div class="pageHeader">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>
                   机号：
                </td>
                <td>
                   <input name="SerialNumber" type="text" value="<%=SerialNumber %>" />
                </td>
                <td>
                    客户姓名：                       
                </td>
                <td>
                   <input name="CustomerName" type="text" value="<%=CustomerName %>" />
                </td>
                <td>
                    客户身份证：                       
                </td>
                <td >
                   <input name="CustomerIDCard" type="text" value="<%=CustomerIDCard %>" />
                </td>
               <td rowspan="2" >
                     <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>            
             <tr>
                <td>
                  机型：                    
                </td>
                <td>
                   <%=GetMacType("select", "MachineType", MachineType)%>
                </td>
                <td>
                    <input type="hidden" name="ShowTimeInput" value="<%=ShowTimeInput?false:ShowTimeInput %>" />
                   交机日期从：
                </td>
                <td >
                   <input name="IntoDateFrom" type="text" value="<%=IntoDateFrom %>"  class="date"/>
                </td>
                <td>
                   到：
                </td>
                <td>
                   <input name="IntoDateTo" type="text" value="<%=IntoDateTo %>"  class="date"/>
                </td>                
                
            </tr>
            <% if(HasPower(IHISCETeim.Web.Permission.经销商平台_公司人员)) { %>
            <tr>
                <td>经销商：</td>
                <td colspan="5">
                    <input name="searchAgentName" type="text" value="<%=searchAgentName %>"  />
                </td>
            </tr>
            <%} %>
        </table>       
    </div>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar" >
            
          <% if (HasPower(IHISCETeim.Web.Permission.新增))
             {%>
            <li><a class="add" href="SvrMgr/UWarrantyCardAgentAdd.aspx" target="navTab" title="添加保修卡" rel="UWarrantyCardAdd"><span>添加</span></a></li>
           <%} %>
          
           <% if (HasPower(IHISCETeim.Web.Permission.修改))
             {%>
            <li><a class="add" href="SvrMgr/UWarrantyCardAgentEdit.aspx?UWCID={sid_user}" target="navTab" title="修改保修卡" rel="UWarrantyCardEdit"><span>修改</span></a></li>
           <%} %>   
            
            <% if (HasPower(IHISCETeim.Web.Permission.新增))
             {%>
            <li><a class="add" href="/MachineSys/sysAjaxDone.ashx?ajaxmethod=addUMacKeep&UWCID={sid_user}" target="ajaxTodo" title="确定要生成定期保养记录吗?此功能用于补充，如果在添加保修卡时已添加过，请不要重复添加."><span>生成定期保养记录</span></a></li>
           <%} %>        
        </ul>
    </div>
    <asp:repeater id="rpMenu" runat="server">
        <HeaderTemplate>
        <table class="table" width="100%" layoutH="162">
        <thead>
            <tr  >   
                 <th width="120">
                    经销商
                </th>              
                <th width="60"  orderField="MachineType" class="asc">
                    机型
                </th>
                <th  width="100" orderField="SerialNumber" class="asc">
                    机号
                </th>
                <th width="100" orderField="IntoDate" class="asc">
                    交机日期
                </th>
                 
                <th width="100">
                    客户姓名
                </th>
                <th width="100" align="center">
                    客户手机
                </th>
                <th width="100">
                    生日
                </th>
                               
                <th width="220">
                    客户地址
                </th>
               <th width="100">
                    交机人员
                </th>
                <th width="100">
                    交机人电话
                </th>
                <th  width="80">延保</th>  
                <th  width="80">破碎器</th>  
                  <th  width="80">质保期限</th>  
             
                <th  width="100">备注说明</th>                            
            </tr>
        </thead>
        <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr target="sid_user" rel="<%# Eval("UWCID") %>">
                <td><%# Eval("AgentName")%></td>
				<td><%# Eval("MachineType")%></td>
				<td>
                <a href="#" onclick="onSerialNumberClick('<%# Eval("SerialNumber")%>')"><%# Eval("SerialNumber")%></a> 
                </td>
				<td><%# Convert.ToDateTime(Eval("IntoDate")).ToString("yyyy-MM-dd")%></td>
               
				<td><%# Eval("CustomerName")%></td>
				<td><%# Eval("CustomerMobile")%></td>
				<td><%# Eval("Birthday")%></td>
                <td><%# Eval("CustomerAddress")%></td>
                <td><%# Eval("AgentSvrPer")%></td>
                <td><%# Eval("AgentSvrPerTel")%></td>
                <td style='color:<%# Convert.ToBoolean(Eval("IsKeepSvr")) ? "" : "red" %>'><%# Convert.ToBoolean(Eval("IsKeepSvr") == DBNull.Value ? 0 : Eval("IsKeepSvr")) ? "是" : "否"%></td>
                 <td style='color:<%# Convert.ToBoolean(Eval("IsBreaker")) ? "" : "red" %>'><%# Convert.ToBoolean(Eval("IsBreaker") == DBNull.Value ? 0 : Eval("IsBreaker")) ? "是" : "否"%></td>
                 <td><%# Convert.ToInt32( Eval("zipaoqixian"))==0?"":Convert.ToInt32( Eval("zipaoqixian"))==1?"12个月不限小时":"15个月或2000小时"%></td>             
                <td><%# Eval("Remark")%></td>
			</tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
         </table>
        </FooterTemplate>
    </asp:repeater>
    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
               <%=SetnumPerPage() %>
            </select>
            <span>条，共<%=TotalCount%>条</span>
        </div>
        <div class="pagination" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
            pagenumshown="10" currentpage="<%=pageNum %>">
        </div>
    </div>
</div>
</form>

<script>

    function onSerialNumberClick(jh)
    {
        <% if(HasPower(IHISCETeim.Web.Permission.经销商平台_公司人员)) { %>
            var rel = "AgentQltySvrActList" + jh;
            var url = "SvrMgr/AgentQltySvrActList.aspx?SerialNumber=" + jh;
            var title = jh + '品情汇总';
            var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
            top.navTab.openTab(rel, url, { title: title, fresh: true, external: true });
        <%}else{%>
        var rel = "AgentQltyList" + jh;
        var url = "SvrMgr/AgentQltyList.aspx?SerialNumber=" + jh;
        var title = jh + '已提交品情清单';
        var options = { width: 850, height: 450, max: false, mask: true, maxable: false, minable: false, fresh: true, resizable: false, drawable: true };
        top.navTab.openTab(rel, url, { title: title, fresh: true, external: true });
        <%}%>
       
    }

</script>